import request from '@/utils/request'

// 查询采购需求列表
export function listWarePurchaseDetail(query) {
  return request({
    url: '/mall/warePurchaseDetail/list',
    method: 'get',
    params: query
  })
}

// 查询采购需求详细
export function getWarePurchaseDetail(id) {
  return request({
    url: '/mall/warePurchaseDetail/' + id,
    method: 'get'
  })
}

// 合并分配采购单
export function mergeAssignPurchaseOrder(data) {
  return request({
    url: '/mall/warePurchaseDetail/mergeAssignPurchaseOrder',
    method: 'post',
    data: data
  })
}

// 新增采购需求
export function addWarePurchaseDetail(data) {
  return request({
    url: '/mall/warePurchaseDetail',
    method: 'post',
    data: data
  })
}

// 修改采购需求

export function updateWarePurchaseDetail(data) {
  return request({
    url: '/mall/warePurchaseDetail',
    method: 'put',
    data: data
  })
}

// 删除采购需求

export function delWarePurchaseDetail(id) {
  return request({
    url: '/mall/warePurchaseDetail/' + id,
    method: 'delete'
  })
}

// 导出采购需求

export function exportWarePurchaseDetail(query) {
  return request({
    url: '/mall/warePurchaseDetail/export',
    method: 'get',
    params: query
  })
}
